1. Technical Field
This invention generally relates to object oriented programming and more specifically relates to an apparatus and method for retrieving information in an object oriented computer system.
2. Background Art
Since the dawn of the computer age, computer systems have evolved into extremely sophisticated devices, and computer systems may be found in many different settings. Computer systems typically include a combination of hardware, such as semiconductors and circuit boards, and software, also known as computer programs. As advances in semiconductor processing and computer architecture push the performance of the computer hardware higher, more sophisticated computer software has evolved to take advantage of the higher performance of the hardware, resulting in computer systems today that are much more powerful than just a few years ago.
One capability that is often needed in computer programs is the ability to use one piece of information (attribute) to retrieve another piece of information (attribute). This capability is generally known as xe2x80x9ckeyingxe2x80x9d, where one attribute is used as a xe2x80x9ckeyxe2x80x9d, or index, to locate and retrieve a different attribute. One known method for keying uses a lookup table that pairs each key to it""s corresponding attribute value. When a client program needs to access the attribute value, it uses the corresponding key to locate the attribute value in the lookup table.
Keys are often used to access information in a database. Many modem databases contain information that includes values associated with a key. For example, a financial account could be specified by a key, and transaction amounts could then be stored in the database using the account as the key. In this manner each transaction may be posted to the proper account. A checkbook register is a well-known example of transactions (check amounts) that are posted to an account (the checking account) that may be represented by a key. For the discussion herein, we refer to a key that is used to access information as an xe2x80x9caccess keyxe2x80x9d.
At times, a user may want to make ad hoc queries on values stored in a database and retrieve summations of the values for various uses, such as creating reports. For common or frequent queries, the user can create condensed sets of information that are continually updated (or cached) as values are added to or removed from the database. Common queries can be encapsulated in a xe2x80x9cspecification keyxe2x80x9d that holds the criteria needed for the query. The summation of balances of items can then be held in a map that includes key-value pairs, with access keys and associated values. Such a map is known as a xe2x80x9ccached balance setxe2x80x9d because the balance of the values specified in the specification key are cached, or continually updated, as any of those values change in the database. By creating cached balance sets, common queries can be satisfied by going to the cached balance sets instead of retrieving the attribute value from the database itself.
Cached balance sets can be condensed as required to include only information of interest. In condensing a cached balance set into other cached balance sets that are subsets, a user can decide whether to include only those values that satisfy the criteria in the specification key, or whether to include all values, simply marking those that do not satisfy the specification key. A user can thus create sets of cached balance sets that satisfy a broad range of criteria. By accessing attribute values within a cached balance set, the system does not have to march through each entry in the database and determine whether the entry matches the criteria in the specification key, but instead can access this same information in a cached balance set, assuming one exists that contains the needed attribute values. The performance penalty for searching each entry in the database is significant, and if queries can be satisfied using cached balance sets, the performance of the computer system is greatly enhanced.
Cached balance sets can be either complete or incomplete. A cached balance set is complete if it contains attribute values within the criteria in the specification key as well as the attribute values that do not satisfy the criteria. A cached balance set is incomplete if it contains only the attribute values that satisfy the criteria in the specification key, potentially excluding attribute values that do not satisfy the criteria. By using a complete cached balance set, the user has the capability of seeing how items within the criteria in the specification key relate to the whole set of data. A simple example is a pie chart that shows all the data in addition to the specific piece or pieces that are specified in the specification key. When an incomplete cached balance set is used, only the specific piece of pieces of the pie that satisfy the specification key are visible, so no broad view of the excluded data is possible.
In some cases, performance can be enhanced by accessing attribute values in incomplete cached balance sets. By having an incomplete set that includes the needed attribute values, the system does not have to process the entries that lie outside of the criteria in the specification key. In addition, because the entries in a cached balance set are updated when the underlying values in the database changes, the excluded entries in an incomplete cached balance set do not have to be updated. However, incomplete cached balance sets present problems when they are used to generate other cached balance sets. Because entries have been potentially excluded, a user does not know whether a new cached balance set formed from an incomplete cached balance set includes all of the relevant values or not.
One way to get around this problem with incomplete cached balance sets is to force all cached balance sets to be complete. This solution, however, has a significant performance penalty because the performance advantages of incomplete cached balance sets discussed above cannot be realized. The prior art solves this problem by simply not allowing any cached balance set to be generated from any incomplete cached balance set. However, there are times when an incomplete cached balance set contains all of the needed data. Without an apparatus and methods that allow using both complete and incomplete cached balance sets for generating new cached balance sets, the computer industry will continue to suffer from methods for accessing attribute values that do not provide the desired flexibility, functionality, and performance.
According to the preferred embodiments, an apparatus and method allow using incomplete cached balance sets to be used to generate other cached balanced sets in certain circumstances. If a cached balance set is complete, a new cached balance set can be generated from it by condensing the existing cached balance set. If the cached balance set is incomplete, a new cached balance set can be created from the existing incomplete cached balance set if the query key meets certain criteria and if the existing cached balance set was condensed from the underlying data in the database itself, rather than from a different cached balance set. It is even possible to create a complete cached balance set from an incomplete cached balance set if certain criteria are met. By using both complete and incomplete cached balance sets to retrieve values in response to a query, the performance of the resulting system is significantly enhanced.
The foregoing and other features and advantages of the invention will be apparent from the following more particular description of preferred embodiments of the invention, as illustrated in the accompanying drawings.